<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <form class="form-horizontal" id="form" method="post" action="{:U('index_update')}">

                            <!-- PAGE CONTENT BEGINS -->

                            <input type="hidden" name="id" value="{$info.id}" id="aid"/>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    姓名 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="name" id="name" placeholder="姓名"
                                           class="col-xs-10 col-sm-5" value="{$info['name']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">姓名不能为空。</span>
											</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    质证编号 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="check_num" id="check_num" placeholder="质证编号"
                                           class="col-xs-10 col-sm-5" value="{$info['check_num']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">质证编号不能为空</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">
                                    讲师简历 </label>
                                <div class="col-sm-9">
                                        <textarea name="content" id="content"
                                                  style="width:100%;height:400px;visibility:hidden;">{$info['content']}</textarea>
                                </div>
                            </div>




                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-3">
                                    直播介绍 </label>
                                <div class="col-sm-9">
                                        <textarea name="intro" id="intro" placeholder="直播介绍"
                                                  class="col-xs-10 col-sm-5"
                                                  rows="5">{$info['intro']}</textarea>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">直播介绍。</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">
                                    人气数 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="pop_num" id="pop_num" placeholder="0"
                                           class="col-xs-10 col-sm-5" value="{$info['pop_num']}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">人气数。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-4">
                                    导师图 </label>
                                <div class="col-sm-9">
                                    <div class="col-xs-10 col-sm-5">
                                        {:UpImage("h_img",100,100,$info['h_img'])}
                                    </div>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">仅支持jpg、gif、png、bmp、jpeg，且小于1MB。</span>
											</span>
                                </div>

                            </div>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-4">
                                    直播推荐图 </label>
                                <div class="col-sm-9">
                                    <div class="col-xs-10 col-sm-5">
                                        {:UpImage("l_img",100,100,$info['l_img'])}
                                    </div>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">仅支持jpg、gif、png、bmp、jpeg，且小于1MB。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>

                            <!-- PAGE CONTENT ENDS -->

                        </form>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        $("#tabs").tabs();
        var editor = KindEditor.create('textarea[name="content"]', {
            uploadJson: '__PUBLIC__/kindeditor/php/upload_json.php',
            fileManagerJson: '__PUBLIC__/kindeditor/php/file_manager_json.php',
            allowFileManager: true,
            afterBlur: function () {
                this.sync();
            }
        });
        $(".submit").click(function () {
            var name = $("#name").val();
            var h_img = $("#h_img").val();
            var content = $("#content").val();
            var check_num = $("#check_num").val();
            var l_img = $("#l_img").val();
            var intro = $("#intro").val();
            if (name == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "姓名不能为空。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (h_img == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "讲师图不能为空。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (content == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "简历不能为空。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (check_num == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "质检编号不能为空。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }

            if (l_img == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "直播推荐图不能为空",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (intro == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "直播介绍不能为空",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            $("#form").submit();
        });
    });
</script>
</body>
</html>
